package com.taotao.wjspringboot.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Scope("mayiktRefresh")
public class ConfigService {

    private String name;
    @Autowired
    private StandardEnvironment environment;

    @RequestMapping("/getConfig")
    public String getConfig() {
        System.out.println("*****");
        environment.getPropertySources().get("sw.name");
        return name;
    }
}
